<?php

namespace app\api\model\examination;

use app\common\exception\BaseException;
use app\common\model\examination\ExaminationUserAward as ExaminationUserAwardModel;


/**
 * 简历模型
 */
class ExaminationUserAward extends ExaminationUserAwardModel
{
    /**
     * 隐藏字段
     */
    protected $hidden = [];

    //获取列表
    public function getList($data,$user)
    {
        $model = $this;
        $list = $model->with(['award.image'])
            ->where('user_id',$user->user_id)
            ->order('id desc')
            ->field("*")
            ->paginate($data);
        return $list;
    }

    //获取列表
    public function getArr()
    {
        $model = $this;
        $list = $model->with(['award.image','user'])
            ->order('id desc')
            ->field("*")
            ->limit(10)
            ->select();
        return $list;
    }

    //获取列表
    public function details($data)
    {
        $model = $this;
        $list = $model->with(['award.image'])
            ->order('id desc')
            ->field("*")
            ->find($data);
        return $list;
    }

}